package com.cx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class index {
    @RequestMapping("/index/Reverse.do")
    @ResponseBody
    private String index(@RequestBody List<String> user){
        StringBuilder u= new StringBuilder(user.get(0));
        int i=0;
        int j=u.length()-1;
        char x;
        while(i<j){
            x=u.charAt(i);

            u.setCharAt(i,u.charAt(j));
            u.setCharAt(j,x);
            i++;
            j--;
        }
        return new String(u);
    }
}
